#pragma once
#ifndef _LIGHTPOSDETECTOR_H
#define _LIGHTPOSDETECTOR_H

#include <opencv/cvaux.h>
#include <opencv/cxmisc.h>
#include <opencv/highgui.h>
#include <opencv/cv.h>

#include "configure.h"
#include "PointInputDevice.h"

#pragma comment (lib, "cxcore200d.lib")
#pragma comment (lib, "cv200d.lib")
#pragma comment (lib, "highgui200d.lib")



class LightPosDetector : public PointInputDevice
{
private:
  CvCapture* _pCamera;
  IplImage* grey_img;
  IplImage* t_img;
  
  CvPoint _find_light_pos() const;

public:
  // ************************************
  // Method:  LightPosDetector::LightPosDetector
  // Usage:   Initial LightPosDetector
  //          Start the camera
  // Access:  public 
  // Returns: void
  // ************************************
  LightPosDetector ();
  ~LightPosDetector ();

  virtual bool get_point_input (OUT Array< float >& pointCoord);
  virtual int get_command_input () { return 0; }
};

#endif